package moh.s2.s2service.impl;

import java.util.List;

import moh.s2.s2dao.AsDao;
import moh.s2.s2entity.AppSettingVO;
import moh.s2.s2service.AsService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class AsServiceImpl implements AsService {

	
	@Autowired
	@Qualifier("asDao")
	private AsDao asDao;
	
	public AsServiceImpl() {
		//ApplicationContext ctx = new ClassPathXmlApplicationContext("appsetting-service.xml");
		//asDao = (AsDao)ctx.getBean("asdao");

	}
	
	@Override
	public AppSettingVO get(int id) {
		return asDao.get(id);
	}
	
	@Override
	public List<AppSettingVO> getAppSettings() {
		System.out.println("asService getAppSettings");

		List<AppSettingVO> lst = asDao.getAppSettings();
		for(AppSettingVO v:lst) {
			//System.out.println(v);
		}
		
		// TODO Auto-generated method stub
		return lst;
	}

	@Override
	public List<AppSettingVO> getAppSettings(String mainId) {
		// TODO Auto-generated method stub
		System.out.println("AsService.getAppSettings " + mainId);
		return asDao.getAppSettings(mainId);
	}

	@Override
	public AppSettingVO getAppSetting(String mainId, String subId) {
		// TODO Auto-generated method stub
		return asDao.getAppSetting(mainId, subId);
	}

	@Override
	public List<AppSettingVO> getAppSettings(AppSettingVO appSettingVO) {
		return asDao.getAppSettings(appSettingVO);
	}

	@Override
	public AppSettingVO add(AppSettingVO appSettingVO) {
		// TODO Auto-generated method stub
		return asDao.add(appSettingVO);
	}

	@Override
	public boolean delete(String mainId, String subId) {
		// TODO Auto-generated method stub
		return asDao.delete(mainId, subId);
	}

	@Override
	public boolean delete(int id) {
		return asDao.delete(id);
	}
	
	@Override
	public AppSettingVO update(AppSettingVO appSettingVO) {
		// TODO Auto-generated method stub
		return asDao.update(appSettingVO);
	}

	public AsDao getAsDao() {
		return asDao;
	}

	
	public void setAsDao(AsDao asDao) {
		this.asDao = asDao;
	}


	
	
}
